import { defHttp } from '/@/utils/http/axios';

enum Api {
  list = '/acl/policy/query',
  delete = '/acl/policy/delete',
  save = '/acl/policy/add',
}

/**
 * 列表接口
 * @param params
 */
export const list = (params) => {
  return defHttp.post({ url: Api.list, params });
};
/**
 * 删除
 */
export const deleteRequest = (params, handleSuccess) => {
  return defHttp.post({ url: Api.delete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
};
/**
 * 保存
 * @param params
 */
export const saveOrUpdate = (params) => {
  return defHttp.post({ url: Api.save, params });
};
